Skip to content

test(provider): fold #1100's benchmark iteration tests into #1096 - #1249

Open
brandon-eigenlabs wants to merge 1 commit into
Layr-Labs:refactor/tooling-consolidatedfrom
brandon-eigenlabs:fold/1100-into-1096
Open

brandon-eigenlabs wants to merge 1 commit into
Layr-Labs:refactor/tooling-consolidatedfrom
brandon-eigenlabs:fold/1100-into-1096

Conversation

@brandon-eigenlabs

@brandon-eigenlabs brandon-eigenlabs commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Folds #1100's remaining changes into #1096 so the two PRs stop adding the same BenchmarkMeasurements.swift. Targets refactor/tooling-consolidated (#1096's branch), not master. Merging this changes #1096 only; @Gajesh2007, it's yours to take or leave.

Why

#1096 and #1100 each create provider-swift/Sources/ProviderBenchmark/BenchmarkMeasurements.swift with an identical milliseconds(_:), so whichever merged second would conflict. #1096's version is a superset (it adds mean and median). The whole-second truncation bug itself (#770) was already fixed on master by #1030. #1100 is regression coverage, and this carries that coverage over.

What moves from #1100

  • ModelBenchmark.iterationResult: the iteration arithmetic (prefill, total, decode TPS) extracted as a pure function of the clock observations, so it is testable without loading a model.
  • The prompt-time fallback now depends on whether a first chunk arrived, instead of on prefillLatencyMs == 0.
  • Tests/ProviderCoreTests/Benchmark/ModelBenchmarkTests.swift: multi-second, sub-second and no-first-chunk cases.
  • A timing-basis paragraph in docs/provider/cli-reference.md (darkbloom benchmark) and a CHANGELOG line.

#1096's own BenchmarkMeasurements and its tests are unchanged.

Behavior

flowchart LR
  subgraph Before["Before (#1096 today)"]
    A1[first chunk?] -->|yes| B1[prefill = chunk time]
    A1 -->|no| C1[prefill = 0]
    C1 --> D1{prefill == 0?}
    B1 --> D1
    D1 -->|yes| E1[prefill = info.promptTime]
    D1 -->|no| F1[decode TPS inline]
    E1 --> F1
  end
  subgraph After
    A2[first chunk?] -->|yes| B2[prefill = chunk time]
    A2 -->|no| C2[prefill = info.promptTime]
    B2 --> F2[decode TPS]
    C2 --> F2
  end
Loading

Code

flowchart LR
  subgraph Before
    R1[runIteration] --> M1[BenchmarkMeasurements.milliseconds]
    R1 --> I1[inline BenchmarkIterationResult]
  end
  subgraph After
    R2[runIteration] --> I2[ModelBenchmark.iterationResult]
    I2 --> M2[BenchmarkMeasurements.milliseconds]
    T2[ModelBenchmarkTests] --> I2
  end
Loading

Verification

On #1096's head (90e4138c9) plus this commit, Metal Toolchain installed, submodules at #1096's pins:

The full provider suite was not run on this branch. If this is merged, #1100 can be closed.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

…s into Layr-Labs#1096

Layr-Labs#1096 already introduces BenchmarkMeasurements with the complete Duration
conversion. Layr-Labs#1100 added regression coverage for the standard benchmark's
iteration arithmetic on top of an identical helper, so both PRs would add
the same file. Carry Layr-Labs#1100's remaining pieces here instead:

- extract ModelBenchmark.iterationResult, a pure function of the clock
  observations, so prefill, total and decode throughput can be tested
  without loading a model;
- choose the prompt-time fallback by whether a first chunk arrived, not by
  prefillLatencyMs == 0;
- test multi-second, sub-second and no-first-chunk iterations;
- document the timing basis in the benchmark CLI reference.

The whole-second truncation itself (Layr-Labs#770) was fixed by Layr-Labs#1030.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Sep 29, 2026

Copy link
Copy Markdown

@brandon-eigenlabs is attempting to deploy a commit to the EigenLabs Team on Vercel.

A member of the Team first needs to authorize it.

This branch was successfully deployed

No deployments
benchmarks — a23252cd Deployed Sep 29, 2026 by brandon-eigenlabs via E2E Benchmarks #1871
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant